package spring ;

import org.springframework.context.ApplicationContext ;
import org.springframework.context.support.ClassPathXmlApplicationContext ;

import spring.customLabel.CustomLabelBean ;

/**
 * @author 80002165 @date 2017年6月14日 下午5:35:29
 */
public class TestSpringMain {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-context.xml") ;
//        testExceptionHandler(context);
        testAop(context);
    }
    
    public static void testCustomLabel(ApplicationContext context) {
        CustomLabelBean bean = (CustomLabelBean) context.getBean("testCustomLabel") ;
        System.out.println(bean.getParam()) ;
    }
    
    public static void testExceptionHandler(ApplicationContext context) {
        SpringTestBean testBean = context.getBean(SpringTestBean.class) ;
        testBean.say(); 
    }
    
    public static void testAop(ApplicationContext context){
        Bean bean = (Bean) context.getBean("bean") ;
        bean.testAnno("fangsh");
    }
}
